/**
 * 
 */
package com.opensource.netty.redis.proxy.sample;

import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

import com.alibaba.fastjson.JSONObject;

import redis.clients.jedis.Jedis;

/**
 * @author liubing
 *
 */
public class RedisClientDemo {

	/**
	 * @param args
	 * @throws Exception 
	 * @throws InterruptedException 
	 */
	public static void main(String[] args) throws InterruptedException, Exception {
		ExecutorService pool = Executors.newFixedThreadPool(10);
		Long startTime=System.currentTimeMillis();
		Jedis  redis = new Jedis ("127.0.0.1",6379);
		Map<String, String> result=redis.hgetAll("people");
		 result=redis.hgetAll("people");
		System.out.println(result.size());
		redis.close();
//		final int count=1000000;
//		Future<?> result=  pool.submit(new Runnable() {
//			
//			@Override
//			public void run() {
//				for(int i=0;i<count;i++){
//					try{
//						redis.get("classRoom");
//					}catch(Exception e){
//						e.printStackTrace();
//					}
//					
//				}
//			}
//		});
//		result.get();
//		Long end=System.currentTimeMillis();
//		long costTime=(end-startTime);
//		redis.close();
//		System.out.println("花费时间:"+costTime);
//		System.out.println("-----结束---------"+(count)/(costTime));

	}

}
